
#pragma once


namespace __OCF_STUB__ 
{


using namespace __OCF_BASE__;




template <class IF>
class CClientToFront
{
	typedef TYPE_LIST11(BYTE,BYTE*,DWORD,DWORD*,USHORT,char,char*,int,int*,long,long*) _OCF_PROXYSTUB_TYPELIST_T;
	enum __ENUM_PROXYSTUB_FUNCTION_TYPE__
	{
		__ENUM_FUNCTION_TYPE_fnRequestRegisterKey__ = 1,
		__ENUM_FUNCTION_TYPE_fnRequestString__ = 2,
		__ENUM_FUNCTION_TYPE_fnRequestEcho__ = 3,
		__ENUM_FUNCTION_TYPE_fnRequestPerfInfo__ = 4,
		__ENUM_FUNCTION_TYPE_fnRequestNetPending__ = 5,
		__ENUM_FUNCTION_TYPE_fnRequestMemPerfInfo__ = 6,
		__ENUM_FUNCTION_TYPE_fnRequestNetPrivatePerfInfo__ = 7,

		__END__
	};
	typedef IF _N_IF_T;
	typedef long (CClientToFront<_N_IF_T>::*_FUNC_T)(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn);

public:
	CClientToFront(_N_IF_T* pcIf = NULL)
		:m_pcIf(pcIf)
	{
		m_ulLenRcvBuff = 0;
		m_pRcvBuff = NULL;
		m_pCurrRcvBuff = NULL;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
		m_ulLenSndBuff = 0;
		m_pSndBuff = NULL;
#endif
		m_ulBindX = 0;
		m_ulIdentity = 0;

	}
	virtual ~CClientToFront()
	{
	}
	CClientToFront& operator =(const CClientToFront& cFrom)
	{
		m_pcIf = cFrom.m_pcIf;
		m_ulLenRcvBuff = cFrom.m_ulLenRcvBuff;
		m_pRcvBuff = cFrom.m_pRcvBuff;
		m_pCurrRcvBuff = cFrom.m_pCurrRcvBuff;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
		m_ulLenSndBuff = cFrom.m_ulLenSndBuff;
		m_pSndBuff = cFrom.m_pSndBuff;
#endif
		m_ulBindX = cFrom.m_ulBindX;
		m_ulIdentity = cFrom.m_ulIdentity;

		return *this;
	}
	long StubDispatch()
	{
		CIn<_OCF_PROXYSTUB_TYPELIST_T> cIn(m_ulLenRcvBuff, m_pRcvBuff);
		USHORT uiCmd;

		if (FALSE == cIn.Pop(uiCmd).IsValid())
		{
			return -3;
		}
		if (uiCmd >= __END__)
		{
			return -4;
		}
		if (NULL == m_apcFunc[uiCmd])
		{
			return -5;
		}

		long lRet = (this->*m_apcFunc[uiCmd])(cIn);
		if (0 <= lRet)
		{
			m_pCurrRcvBuff = cIn.GetCurrDataPtr();
		}

		return lRet; 
	}

public:
	inline void SetIf(_N_IF_T* pcIf) { m_pcIf = pcIf; }

#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
	inline void SetStubInfo(ULONG ulBindX, ULONG ulIdentity, ULONG ulLenRcvBuff, const void* pRcvBuff, ULONG ulLenSndBuff = 0, void* pSndBuff = NULL) { m_ulBindX = ulBindX; m_ulIdentity = ulIdentity; m_ulLenRcvBuff = ulLenRcvBuff; m_pRcvBuff = pRcvBuff; m_pCurrRcvBuff = pRcvBuff; m_ulLenSndBuff = ulLenSndBuff; m_pSndBuff = pSndBuff; }

	inline ULONG GetLengthRcvBuff() { return m_ulLenRcvBuff; }
	inline ULONG GetLengthSndBuff() { return m_ulLenSndBuff; }
	inline void* GetRcvBuff() { return m_pRcvBuff; }
	inline void* GetSndBuff() { return m_pSndBuff; }
	inline void* GetCurrRcvBuff() { return m_pCurrRcvBuff; }
#else
	inline void SetStubInfo(ULONG ulBindX, ULONG ulIdentity, ULONG ulLenRcvBuff, const void* pRcvBuff) { m_ulBindX = ulBindX; m_ulIdentity = ulIdentity; m_ulLenRcvBuff = ulLenRcvBuff; m_pRcvBuff = pRcvBuff; m_pCurrRcvBuff = pRcvBuff; }

	inline ULONG GetLengthSndBuff() { return m_ulLenRcvBuff; }
	inline void* GetSndBuff() { return m_pRcvBuff; }
	inline void* GetCurrRcvBuff() { return m_pCurrRcvBuff; }
#endif
private:
	inline ULONG GetBindX() { return m_ulBindX; }
	inline ULONG GetIdentity() { return m_ulIdentity; }
private:
	long fnRequestRegisterKey(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		ULONG nLenLocalIP;char * pszLocalIP;DWORD dwUserSn;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(nLenLocalIP,(const char ** )(&pszLocalIP)).Pop(dwUserSn).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnRequestRegisterKey(GetBindX(),GetIdentity(),(int )nLenLocalIP,pszLocalIP,dwUserSn);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnRequestString(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		int nAuthKey;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(nAuthKey).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnRequestString(GetBindX(),GetIdentity(),nAuthKey);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnRequestEcho(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		ULONG nInLen;char * pszString;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(nInLen,(const char ** )(&pszString)).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnRequestEcho(GetBindX(),GetIdentity(),(int )nInLen,pszString);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnRequestPerfInfo(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnRequestPerfInfo(GetBindX(),GetIdentity());
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnRequestNetPending(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnRequestNetPending(GetBindX(),GetIdentity());
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnRequestMemPerfInfo(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnRequestMemPerfInfo(GetBindX(),GetIdentity());
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnRequestNetPrivatePerfInfo(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnRequestNetPrivatePerfInfo(GetBindX(),GetIdentity());
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}

private:
	static _FUNC_T m_apcFunc[__END__];
	_N_IF_T* m_pcIf;
	ULONG m_ulLenRcvBuff;
	const void* m_pRcvBuff;
	const void* m_pCurrRcvBuff;
	ULONG m_ulLenSndBuff;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
	void* m_pSndBuff;
#endif
	ULONG m_ulBindX;
	ULONG m_ulIdentity;
};

template <class IF>
typename CClientToFront<IF>::_FUNC_T CClientToFront<IF>::m_apcFunc[__END__] = {
	NULL,
	&CClientToFront<IF>::fnRequestRegisterKey,
	&CClientToFront<IF>::fnRequestString,
	&CClientToFront<IF>::fnRequestEcho,
	&CClientToFront<IF>::fnRequestPerfInfo,
	&CClientToFront<IF>::fnRequestNetPending,
	&CClientToFront<IF>::fnRequestMemPerfInfo,
	&CClientToFront<IF>::fnRequestNetPrivatePerfInfo,
};


#undef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__


template <class IF>
class CFrontToClient
{
	typedef TYPE_LIST11(BYTE,BYTE*,DWORD,DWORD*,USHORT,char,char*,int,int*,long,long*) _OCF_PROXYSTUB_TYPELIST_T;
	enum __ENUM_PROXYSTUB_FUNCTION_TYPE__
	{
		__ENUM_FUNCTION_TYPE_fnReturnRegisterKey__ = 101,
		__ENUM_FUNCTION_TYPE_fnReturnString__ = 102,
		__ENUM_FUNCTION_TYPE_fnReturnEcho__ = 103,
		__ENUM_FUNCTION_TYPE_fnReturnPerfInfo__ = 104,
		__ENUM_FUNCTION_TYPE_fnReturnNetPendingPerfInfo__ = 105,
		__ENUM_FUNCTION_TYPE_fnReturnMemPerfInfo__ = 106,
		__ENUM_FUNCTION_TYPE_fnReturnNetPrivatePerfInfo__ = 107,

		__END__
	};
	typedef IF _N_IF_T;
	typedef long (CFrontToClient<_N_IF_T>::*_FUNC_T)(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn);

public:
	CFrontToClient(_N_IF_T* pcIf = NULL)
		:m_pcIf(pcIf)
	{
		m_ulLenRcvBuff = 0;
		m_pRcvBuff = NULL;
		m_pCurrRcvBuff = NULL;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
		m_ulLenSndBuff = 0;
		m_pSndBuff = NULL;
#endif
		m_ulBindX = 0;
		m_ulIdentity = 0;

	}
	virtual ~CFrontToClient()
	{
	}
	CFrontToClient& operator =(const CFrontToClient& cFrom)
	{
		m_pcIf = cFrom.m_pcIf;
		m_ulLenRcvBuff = cFrom.m_ulLenRcvBuff;
		m_pRcvBuff = cFrom.m_pRcvBuff;
		m_pCurrRcvBuff = cFrom.m_pCurrRcvBuff;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
		m_ulLenSndBuff = cFrom.m_ulLenSndBuff;
		m_pSndBuff = cFrom.m_pSndBuff;
#endif
		m_ulBindX = cFrom.m_ulBindX;
		m_ulIdentity = cFrom.m_ulIdentity;

		return *this;
	}
	long StubDispatch()
	{
		CIn<_OCF_PROXYSTUB_TYPELIST_T> cIn(m_ulLenRcvBuff, m_pRcvBuff);
		USHORT uiCmd;

		if (FALSE == cIn.Pop(uiCmd).IsValid())
		{
			return -3;
		}
		if (uiCmd >= __END__)
		{
			return -4;
		}
		if (NULL == m_apcFunc[uiCmd])
		{
			return -5;
		}

		long lRet = (this->*m_apcFunc[uiCmd])(cIn);
		if (0 <= lRet)
		{
			m_pCurrRcvBuff = cIn.GetCurrDataPtr();
		}

		return lRet; 
	}

public:
	inline void SetIf(_N_IF_T* pcIf) { m_pcIf = pcIf; }

#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
	inline void SetStubInfo(ULONG ulBindX, ULONG ulIdentity, ULONG ulLenRcvBuff, const void* pRcvBuff, ULONG ulLenSndBuff = 0, void* pSndBuff = NULL) { m_ulBindX = ulBindX; m_ulIdentity = ulIdentity; m_ulLenRcvBuff = ulLenRcvBuff; m_pRcvBuff = pRcvBuff; m_pCurrRcvBuff = pRcvBuff; m_ulLenSndBuff = ulLenSndBuff; m_pSndBuff = pSndBuff; }

	inline ULONG GetLengthRcvBuff() { return m_ulLenRcvBuff; }
	inline ULONG GetLengthSndBuff() { return m_ulLenSndBuff; }
	inline void* GetRcvBuff() { return m_pRcvBuff; }
	inline void* GetSndBuff() { return m_pSndBuff; }
	inline void* GetCurrRcvBuff() { return m_pCurrRcvBuff; }
#else
	inline void SetStubInfo(ULONG ulBindX, ULONG ulIdentity, ULONG ulLenRcvBuff, const void* pRcvBuff) { m_ulBindX = ulBindX; m_ulIdentity = ulIdentity; m_ulLenRcvBuff = ulLenRcvBuff; m_pRcvBuff = pRcvBuff; m_pCurrRcvBuff = pRcvBuff; }

	inline ULONG GetLengthSndBuff() { return m_ulLenRcvBuff; }
	inline void* GetSndBuff() { return m_pRcvBuff; }
	inline void* GetCurrRcvBuff() { return m_pCurrRcvBuff; }
#endif
private:
	inline ULONG GetBindX() { return m_ulBindX; }
	inline ULONG GetIdentity() { return m_ulIdentity; }
private:
	long fnReturnRegisterKey(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		BYTE byRes;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(byRes).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnReturnRegisterKey(GetBindX(),GetIdentity(),byRes);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnReturnString(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		ULONG nLenReturn;char * pszReturn;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(nLenReturn,(const char ** )(&pszReturn)).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnReturnString(GetBindX(),GetIdentity(),(int )nLenReturn,pszReturn);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnReturnEcho(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		ULONG nLenReturn;char * pszReturn;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(nLenReturn,(const char ** )(&pszReturn)).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnReturnEcho(GetBindX(),GetIdentity(),(int )nLenReturn,pszReturn);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnReturnPerfInfo(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		long lConnCount;long lDisConnCount;long lMissConnCount;long lCurConnCount;long lAllocateCount;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(lConnCount).Pop(lDisConnCount).Pop(lMissConnCount).Pop(lCurConnCount).Pop(lAllocateCount).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnReturnPerfInfo(GetBindX(),GetIdentity(),lConnCount,lDisConnCount,lMissConnCount,lCurConnCount,lAllocateCount);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnReturnNetPendingPerfInfo(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		long lMaxBindX;long lMaxIdentity;long lMaxSndPendingCount;long lSessionCount;long lTotalSndPendingCount;long lTotalSndCount;long lTotalRcvCount;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(lMaxBindX).Pop(lMaxIdentity).Pop(lMaxSndPendingCount).Pop(lSessionCount).Pop(lTotalSndPendingCount).Pop(lTotalSndCount).Pop(lTotalRcvCount).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnReturnNetPendingPerfInfo(GetBindX(),GetIdentity(),lMaxBindX,lMaxIdentity,lMaxSndPendingCount,lSessionCount,lTotalSndPendingCount,lTotalSndCount,lTotalRcvCount);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnReturnMemPerfInfo(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		long lBuffPoolCount;long lBuffAllocCount;long lBuffDeallocCount;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(lBuffPoolCount).Pop(lBuffAllocCount).Pop(lBuffDeallocCount).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnReturnMemPerfInfo(GetBindX(),GetIdentity(),lBuffPoolCount,lBuffAllocCount,lBuffDeallocCount);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}
	long fnReturnNetPrivatePerfInfo(CIn<_OCF_PROXYSTUB_TYPELIST_T>& cIn_A3C01056_FD2D_4800_912C_69683F47B599_)
	{
		long lSndPendingCount;long lSndCount;long lRcvCount;
		if (FALSE == cIn_A3C01056_FD2D_4800_912C_69683F47B599_.Pop(lSndPendingCount).Pop(lSndCount).Pop(lRcvCount).IsValid()) return -1;
		long _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_ = m_pcIf->fnReturnNetPrivatePerfInfo(GetBindX(),GetIdentity(),lSndPendingCount,lSndCount,lRcvCount);
		return _lRet742173F4_8580_42ce_BF4E_4828036EB6A6_;
	}

private:
	static _FUNC_T m_apcFunc[__END__];
	_N_IF_T* m_pcIf;
	ULONG m_ulLenRcvBuff;
	const void* m_pRcvBuff;
	const void* m_pCurrRcvBuff;
	ULONG m_ulLenSndBuff;
#ifdef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
	void* m_pSndBuff;
#endif
	ULONG m_ulBindX;
	ULONG m_ulIdentity;
};

template <class IF>
typename CFrontToClient<IF>::_FUNC_T CFrontToClient<IF>::m_apcFunc[__END__] = {
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	NULL,
	&CFrontToClient<IF>::fnReturnRegisterKey,
	&CFrontToClient<IF>::fnReturnString,
	&CFrontToClient<IF>::fnReturnEcho,
	&CFrontToClient<IF>::fnReturnPerfInfo,
	&CFrontToClient<IF>::fnReturnNetPendingPerfInfo,
	&CFrontToClient<IF>::fnReturnMemPerfInfo,
	&CFrontToClient<IF>::fnReturnNetPrivatePerfInfo,
};


#undef __SYNC_CALL_7C82602D_4E46_47a6_BFDD_AD8D42FA3FCD__
}
